/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package converter;

/**
 *
 * @author user1
 */
public class Tablatura {
 
    public String row1 = "-";
    public String row2 = "-";
    public String row3 = "-";
    public String row4 = "-";
    public String row5 = "-";
    public String row6 = "-";
    
    public int max = 7;
    
    public char [] result = new char [7];
    public char [] result2 = new char [7];
    
    public Tablatura(){
        
        result [0] = '0';
        result [1] = '1';
        result [2] = '2';
        result [3] = '3';
        result [4] = '4';
        result [5] = '5';
        result [6] = '|';
        
        result2 [0] = '1';
        result2 [1] = '2';
        result2 [2] = '3';
        result2 [3] = '4';
        result2 [4] = '5';
        result2 [5] = '6';
        result2 [6] = '0';
        
        
        
        
    }
    
    public void borrar(){
        
        row1 = "-";
        row2 = "-";
        row3 = "-";
        row4 = "-";
        row5 = "-";
        row6 = "-";
    }
    
    
    public void decode(){
        
        int contador;
        char prox;
        String proxa;
        
        for (contador = 0;contador < max; contador++ ){
            
            if(this.result[contador] == '0' ){
                
                prox = this.result2[contador];
                proxa = Character.toString(prox);
                row1 = row1+proxa+"-";
                
                
                row1.concat(proxa+"-");
                row2 = row2 + "--";
                row3 = row3 + "--";
                row4 = row4 + "--";
                row5 = row5 + "--";
                row6 = row6 + "--";
            
            }else if(this.result[contador] == '1' ){
                
                prox = this.result2[contador];
                proxa = Character.toString(prox);
                row2 = row2+proxa+"-";
                row1 = row1 + "--";
                row3 = row3 + "--";
                row4 = row4 + "--";
                row5 = row5 + "--";
                row6 = row6 + "--";
                
                
            }else if(this.result[contador] == '2' ){
                
                prox = this.result2[contador];
                proxa = Character.toString(prox);
                row3 = row3+proxa+"-";
                row1 = row1 + "--";
                row2 = row2 + "--";
                row4 = row4 + "--";
                row5 = row5 + "--";
                row6 = row6 + "--";
                
                
            }else if(this.result[contador] == '3' ){
                
                prox = this.result2[contador];
                proxa = Character.toString(prox);
                row4 = row4+proxa+"-";
                row1 = row1 + "--";
                row3 = row3 + "--";
                row2 = row2 + "--";
                row5 = row5 + "--";
                row6 = row6 + "--";
                
                
            }else if(this.result[contador] == '4' ){
                
                prox = this.result2[contador];
                proxa = Character.toString(prox);
                row5 = row5+proxa+"-";
                row1 = row1 + "--";
                row3 = row3 + "--";
                row4 = row4 + "--";
                row2 = row2 + "--";
                row6 = row6 + "--";
                
                
            }else if(this.result[contador] == '5' ){
                
                prox = this.result2[contador];
                proxa = Character.toString(prox);
                row6 = row6+proxa+"-";
                row1 = row1 + "--";
                row3 = row3 + "--";
                row4 = row4 + "--";
                row2 = row2 + "--";
                row5 = row5 + "--";
                
                
            }else if(this.result[contador] == '|'){
                
                row1 = row1 + "|-";
                row2 = row2 + "|-";
                row3 = row3 + "|-";
                row4 = row4 + "|-";
                row5 = row5 + "|-";
                row6 = row6 + "|-";
                
                
            }              
                    
                    
                            
            
                
                
        }
        
        
        
        
    }
    
    
    
    
    
}
